<?php

use yii\helpers\Html;
//use yii\grid\GridView;
use kartik\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\MallProductSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '产品';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="mall-product-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('添加产品', ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'export' => false,
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'aid',
            'mid',
            'cid',
            'title',
            //'img',
            [
                'attribute' => 'img',
                'enableSorting' => false,
                'format' => ['image', [
                    'width' => '80',
                    'height' => '80',
                ]],
            ],
            //'imgs:ntext',
            //'detail:ntext',
            //'detail_text:ntext',
            'old_price',
            'freight',
            //'sort',
            [
                'attribute' => 'sort',
                'class' => 'kartik\grid\EditableColumn',
            ],
            'count_sale',
            'is_up',
            //'up_time:datetime',
            //'update_time:datetime',
            'create_time:datetime',
            'status',
            //'parent_id',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
</div>
